﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WorkStation.Frameworks.EasyBus.Serializable
{
    /// <summary>
    /// 消息序列化接口
    /// </summary>
    public interface IMessageSerializable
    {
        /// <summary>
        /// 对象到 json 转化
        /// </summary>
        /// <param name="obj">源对象</param>
        /// <returns></returns>
        string ObjectToJson(object obj);

        /// <summary>
        /// json 到对象的转化
        /// </summary>
        /// <param name="json">json字串</param>
        /// <param name="objectType">对象类型</param>
        /// <returns></returns>
        object JsonToObject(string json, Type objectType);
    }
}
